﻿<form action="users.php" method="post" id = "search">
    <?php
    if(!get_magic_quotes_gpc())
    {
        $searchterm_username = addslashes($searchterm_username);
        $searchterm_fname = addslashes($searchterm_fname);
        $searchterm_lname = addslashes($searchterm_lname);
        $searchterm_phone = addslashes($searchterm_phone);
        $searchterm_email = addslashes($searchterm_email);
        $searchterm_role = addslashes($searchterm_role);
    }

    if (mysqli_connect_error())
    {
        echo 'Error: could not connect to database. Please try again later.';
        exit;
    }
    ?>

    <table class = "table_search">
        <tr>
            <td><label>Username</label></td>
            <td><input id="searchterm_username" class="search_input" type="text" name="searchterm_username"></td>

            <td><label>First Name</label></td>
            <td><input id="searchterm_fname" class="search_input" type="text" name="searchterm_fname"></td>

            <td><label>Last Name</label></td>
            <td><input id="searchterm_lname" class="search_input" type="text" name="searchterm_lname"></td>
        </tr>
        <tr>
            <td><label>Location</label></td>
            <td><input id="searchterm_location" class="search_input" type="text" name="searchterm_location"></td>

            <td><label>Phone</label></td>
            <td><input id="searchterm_phone" class="search_input" type="text" name="searchterm_phone"></td>

            <td><label>Email</label></td>
            <td><input id="searchterm_email" class="search_input" type="text" name="searchterm_email"></td>
        </tr>
        <tr>
            <td><label>User Role</label></td>
            <td><select id="searchterm_role" class="search_input" type="text" name="searchterm_role">
                <option value="">All</option>
                <option value="1">Administrator</option>
                <option value="4">Individual</option>
            </select> </td>
        </tr>
    </table>
    <table  class = "table_search">
        <td><input type="submit" value="Search" id="search_btn"></td>
    </table>

</form>